﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using OnTheWay.Functions;
using Models;
using System.ComponentModel;
using LocalService;

namespace PcBackgroundMgr.Functions
{
    /// <summary>
    /// ExhibitTypeModelCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class ExhibitTypeModelCtrl : ExhibitTypeModelCtrlBase
    {
        public ExhibitTypeModelCtrl()
        {
            InitializeComponent();
        }
    }

    [DesignTimeVisible(false)]
    public partial class ExhibitTypeModelCtrlBase : FunctionCtrlModel<ExhibitType>
    {
        public ExhibitTypeModelCtrlBase()
            :base(LocalFactory.ExhibitTypeLocal)
        {
            this.AddCheck("Name", "名称");
        }

        public override ExhibitType OnInitializeModel(ExhibitType model)
        {
            if (model == null)
            {
                model = new ExhibitType();
                this.Title = "添加类型";
            }
            else
            {
                this.Title = "编辑类型";
            }
            return model;
        }
    }
}
